<script src="<?php echo base_url() ?>commons/validacion/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<link href="<?php echo base_url() ?>commons/validacion/css/validationEngine.jquery.css" rel="stylesheet">
<script src="<?php echo base_url() ?>commons/validacion/js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo base_url() ?>commons/validacion/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

<script>
    var t1 = jQuery.noConflict();
    t1(document).ready(function() {
        // binds form submission and fields to the validation engine			
        t1("#formID").validationEngine();
        // alert('sss');
    });

    /**
     *
     * @param {jqObject} the field where the validation applies
     * @param {Array[String]} validation rules for this field
     * @param {int} rule index
     * @param {Map} form options
     * @return an error string if validation failed
     */
    function checkHELLO(field, rules, i, options) {
        if (field.val() != "HELLO") {
            // this allows to use i18 for the error msgs
            return options.allrules.validate2fields.alertText;
        }
    }
</script>

<form class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/rubro_controlador/ingresodatos" ?>" method="post" id="formID">
    <legend>CREAR DATOS DE RUBROS</legend>
    <div class="control-group">
        <label class="control-label" for="input01">Nombre del Rubro</label>
        <div class="controls">
            <input type="text" class="input-medium span3 validate[required,maxSize[55],minSize[1]]"  name="nombre_rubro" id="nombre_rubro" />           

        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input03"> Costo del Rubro</label>
        <div class="controls">
            <input type="text" class="input-medium span3 validate[required,minSize[1],custom[number]]"  name="costo_rubro" id="costo_rubro" />            

        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input04"> Periodo académico</label>
        <div class="controls">
             <select id="ide_lec" name="ide_lec" class="span3 validate[required,maxSize[55],minSize[1]]"  >
                <?php
                //echo ("<option value='' selected>Seleccionar Carrera</option>");
                echo '<option value="" selected>Seleccione una opción</option>';

                foreach ($lista as $i => $per) {
                    $seleccion = $per["estado_lec"] == 'ABIERTO' ? "Selected" : "";
                    echo '<option value="' . $per["ide_lec"] . '" ' . $seleccion . '>' . $per["descripcion_lec"] . '</option>';
                }
                ?>
            </select>            

        </div>
    </div>

    

    <div class="controls">
        <button type="submit" class="btn">Grabar Datos</button>
        <a href="<?php echo base_url() . "admin.php/rubro_controlador/index" ?>">
            <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>
    </div> 

</form>

